<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
  <body>
    <button id="btn">添加</button>
    <div id="box">

    </div>
  </body>
  <script src="./common.js"></script>
  <script>
    // 9. 在box元素中动态创建无序列表，自定义列表项内容。

    var data = {
      zs: 18,
      ls: 20,
      ww: 23,
      zl: 19
    }
    var box = my$('#box')
    var btn = my$('#btn')
    btn.onclick = function () {
      var ul = document.createElement('ul')
      for (var key in data) {
        var li = document.createElement('li')
        li.innerText = `名字: ${key}, 年龄: ${data[key]}`
        ul.appendChild(li)
      }
      box.appendChild(ul)
    }
  </script>
</html>
